const express = require("express");
const router = express.Router();

const pool = require("../../../src/pg/config/pg");
//查询所有的数据
router.get("/query", async (req, res) => {
    await pool.query("SELECT * FROM chat  LIMIT 100", (err, resq) => {
      if (err) {
        return res.status(200).json({ id: "1", name: "获取后台数据失败" });
        pool.end;
      }
      res.status(200).json(resq.rows);
      pool.end;
    });
  });


module.exports = router